{include file="public/header" /}
<link rel="stylesheet" href="https://cache.amap.com/lbs/static/main1119.css" />
<style>
    .bbbmmm{
        margin-top: 330px;
    }
    #container{
        height: 350px;
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">视频标题：</label>
                            <div class="layui-input-block">
                                <input type="text" name="v_title" value="{$info.v_title}" placeholder="视频标题" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">置顶标题：</label>
                            <div class="layui-input-block">
                                <input type="text" name="v_top_title" value="{$info.v_top_title}" placeholder="置顶标题" class="layui-input ">
                            </div>
                        </div>
                        {if $agid != 10}
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">选择设计师：</label>
                            <div class="layui-input-block">
                                <select name="v_pp_id"  lay-search="" lay-verify="required">
                                    {foreach name="pps" item="v"}
                                    <option value="{$v.user_id}" {if $v.user_id==$info.v_pp_id}selected{/if}>{$v.user_d_name}({$v.user_phone})</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        {/if}
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">上传视频：</label>
                            <input type="hidden" name="v_url" id="lay-img2" lay-verify="image" value="{$info.v_url}">
                            <div class="layui-input-block">
                                <div id="lay-upload2">上传视频</div>
                                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                    预览：
                                    <div class="layui-upload-list" id="lay-list2">
                                        <video class="layui-append-img" src="{$info.v_url}" controls="controls"></video>
                                    </div>
                                </blockquote>
                            </div>
                        </div>
                        {if $agid != 10}
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">是否置顶：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="v_top" value="1" title="否" {if $info.v_top == 1}checked{/if}>
                                <input type="radio" name="v_top" value="2" title="是" {if $info.v_top == 2}checked{/if}>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">是否推荐：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="v_info_top" value="1" title="否" {if $info.v_info_top == 1}checked{/if}>
                                <input type="radio" name="v_info_top" value="2" title="是" {if $info.v_info_top == 2}checked{/if}>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">排序值</label>
                            <div class="layui-input-block">
                                <input type="number" placeholder="值越大越靠前" value="{$info.v_sort}" name="v_sort" maxlength="11" class="layui-input" lay-verify="number" >
                            </div>
                        </div>
                        {/if}
                        <input type="hidden" value="{$info.v_id}" name="v_id">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    wk.uploadImg({size:50,type:'mp4,MP4,Mp4,mP4',url:"{:url('Upload/upload')}",domain:"",video:3});
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('newEdit')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>

</body>
</html>